#! /bin/sh
TOMCAT_HOME=/usr/local/tomcat
ANT_HOME=/usr/local/ant
PROJECT_NAME=pay

# build
$ANT_HOME/bin/ant dist
 
# stop server
service tomcat stop
 
# publish
rm -rf $TOMCAT_HOME/webapps/pay/
mv dist/ $TOMCAT_HOME/webapps/pay

chown -R tomcat:tomcat $TOMCAT_HOME/webapps/pay

# start server
service tomcat start

tail -f $TOMCAT_HOME/logs/catalina.out